package com.example.controller;


import com.example.entity.User;
import com.example.service.UserService;
import com.example.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public ResponseResult login(@RequestBody User user){
        return userService.login(user);
    }

    @GetMapping("/test")
    public String test(){
        return new String("1234");
    }

    @PostMapping("/logout")
    public ResponseResult logout(){
        return ResponseResult.okResult();
    }
}
